/**
 * Created by ebalmes Oct 8, 2009 4:23:09 PM
 * 
 */
package gui.table;

import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.table.AbstractTableModel;

public class SearchPatientTable extends JTable
{
  
  
  public SearchPatientTable(AbstractTableModel model) {
    super(model);
    setAutoCreateRowSorter(true);
  }
  
  public void valueChanged(ListSelectionEvent e) {
    if (getSelectedRow() >=0) {
      ListSelectionModel selectionModel = 
        getSelectionModel();
      selectionModel.setSelectionInterval(getSelectedRow(), getSelectedRow());
      System.out.println(getModel().getValueAt(getSelectedRow(),0)); }
  }
  
}
